package com.lagou.rabbitmq.demo.listener;

import com.lagou.rabbitmq.demo.dao.Order;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.messaging.handler.annotation.Payload;
import org.springframework.stereotype.Component;

@Component
public class MyRabbitListener {
    @RabbitListener(queues = "queue.dlx")
    public void onMessage(@Payload String orderId){
        // 放入另一张超时表。
        System.out.println("是过期的订单号" + orderId);
    }

    @RabbitListener(queues = "queue.biz.unpay")
    public void onBizMessage(@Payload String orderId){
        System.out.println("等待支付的订单号：" + orderId);
    }
}
